import multiprocessing as mp

import numpy as np

import main
import warnings
warnings.filterwarnings("ignore")

if __name__ == "__main__":
    pool=mp.Pool(processes=10)
    for s in range(3,15):
        task_load=s*10
        rl_list=[]
        process_list=[]
        for i in range(30):
            p=pool.apply_async(main.one_play,(300,task_load))
            process_list.append(p)
        for p in process_list:
            rl=p.get()
            rl_list.append(rl)
        print('当前负载+'+str(task_load))
        # dff_list = np.array(dff_list)
        # print(np.average(dff_list))
        # print(np.std(dff_list))
        #
        # kff_list=np.array(kff_list)
        # print(np.average(kff_list))
        # print(np.std(kff_list))
        #
        # lff_list=np.array(lff_list)
        # print(np.average(lff_list))
        # print(np.std(lff_list))

        rl_list=np.array(rl_list)
        print(np.average(rl_list))
        print(np.std(rl_list))
    pool.close()


